package com.tangtang.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.tangtang.gulimall.product.Grops.AddGrops;
import com.tangtang.gulimall.product.Grops.UpdateGrops;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 属性分组
 * 
 * @author tangtang
 * @email a1104707271@vip.qq.com
 * @date 2020-09-11 15:22:08
 */
@Data
@TableName("pms_attr_group")
public class AttrGroupEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 分组id
	 */
	@TableId
    @NotNull(message = "{attrgroup.update}",groups = UpdateGrops.class)
    @Null(message = "{attrgroup.add}",groups = AddGrops.class)
    @Min(value = 0,message = "{attrgroup.mid}",groups = AddGrops.class)
	private Long attrGroupId;
	/**
	 * 组名
	 */
	@NotBlank(message = "{attrgroup.name}",groups = {AddGrops.class,UpdateGrops.class})
	private String attrGroupName;
	/**
	 * 排序
	 */
	@Min(value = 0,message = "{attrgroup.sort}",groups = {AddGrops.class,UpdateGrops.class})
	private Integer sort;
     /**
	 * 描述
	 */
	private String descript;
	/**
	 * 组图标
	 */
	private String icon;
	/**
	 * 所属分类id
	 */
	@Min(value = 0,message = "{attrgroup.mid}",groups = {AddGrops.class,UpdateGrops.class})
    @NotNull(message = "{attrgroup.id}",groups = {AddGrops.class,UpdateGrops.class})
	private Long catelogId;

    /**
     * 添加一个字段返回一个路径(非数据库字段，添加注解)
     */
    @TableField(exist = false)
    private Long[] catelogPath;
}
